home *** CD-ROM | disk | FTP | other *** search
- Path: castle.nando.net!news
- From: actuary@nando.net (Bill McCarthy)
- Newsgroups: comp.lang.c
- Subject: Re: argc/argv & switches
- Date: 9 Mar 1996 04:07:11 GMT
- Organization: Nando.net Public Access
- Message-ID: <4hr05f$2gs@castle.nando.net>
- References: <4h2j8j$9gn@milo.freenet.vancouver.bc.ca> <4hl52oINNa4l@anvil.ugrad.cs.ubc.ca> <danpop.826238070@rscernix> <4ho9dv$bcb@castle.nando.net> <4hodbuINNlvv@keats.ugrad.cs.ubc.ca>
- Reply-To: actuary@nando.net (Bill McCarthy)
- NNTP-Posting-Host: grail1912.nando.net
- X-Newsreader: IBM NewsReader/2 v1.2
-
- In <4hodbuINNlvv@keats.ugrad.cs.ubc.ca>, c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku) writes:
- >In article <4ho9dv$bcb@castle.nando.net>,
- >Bill McCarthy <actuary@nando.net> wrote:
- > >In <danpop.826238070@rscernix>,
- > >danpop@mail.cern.ch (Dan Pop) writes:
- > >
- > >>In <4hl52oINNa4l@anvil.ugrad.cs.ubc.ca>
- > >>c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku) writes:
- > >>
- > >>>However, if it were the case that these pointers are not modifiable,
- > >>
- > >>It _is_ the case. An attempt to modify a pointer from the argv "array"
- > >>results in undefined behaviour.
- > >
- > >According to Herbert Schildt, 5.1.2.2.1 states "The parameters argc and
- > >argv and the strings pointed to by the argv array shall be modifiable
- > >by the program, and retain their last-stored values between program
- > >startup and program termination."
- > >
- > >I'm just reading the standard for the first time, and am only up to page
- > >26 :-( so be kind - what am I missing?
- >
- >You are missing the observation that argv is a pointer to an array of objects.
- >These objects are pointers to char. Although argv is modifiable, these char
- >pointers are not. The funny thing is that the data they point to _is_
- >modifiable.
-
- Actually, I understood the standard. I misread Dan Pop's comment. I reread
- the comment and, as unual, Dan is quite clearly referring to the pointers --
- not the strings.
-
- Bill McCarthy
- actuary@nando.net
- Wendell, NC USA
-
-